feat: Add full Taxonomy and Terms API to .NET CMA SDK#138
Merged
OMpawar-21 merged 3 commits intodevelopmentfrom Mar 11, 2026
Merged
feat: Add full Taxonomy and Terms API to .NET CMA SDK#138OMpawar-21 merged 3 commits intodevelopmentfrom
OMpawar-21 merged 3 commits intodevelopmentfrom
Conversation
- Add Taxonomy and Term support to match the JavaScript CMA SDK. Models: - TaxonomyModel, TermModel (with TermAncestorDescendant, TermMoveModel), TaxonomyImportModel (IUploadInterface for multipart import). Taxonomy: - CRUD, Query(), Export(), Locales(), Localize(), Import(), Terms(termUid). - Stack.Taxonomy(uid) entry point. Term: - CRUD, Query(), Ancestors(), Descendants(), Move(), Locales(), Localize(), Search(typeahead). - Accessed via Stack.Taxonomy(taxonomyUid).Terms() / .Terms(termUid). Services: - Reuse CreateUpdateService, FetchDeleteService, QueryService; extend UploadService with optional query params for Import. Tests: - Unit: TaxonomyTest, TermTest (20 tests). Integration: Contentstack017_TaxonomyTest (create, fetch, query, update, delete). Use static taxonomy UID in integration test so all steps use the same created taxonomy.
cs-raj
approved these changes
Mar 10, 2026
sunil-lakshman
previously approved these changes
Mar 10, 2026
cs-raj
requested changes
Mar 10, 2026
Contentstack.Management.Core.Tests/IntegrationTest/Contentstack017_TaxonomyTest.cs
Outdated
Show resolved
Hide resolved
cs-raj
reviewed
Mar 10, 2026
Contentstack.Management.Core.Tests/IntegrationTest/Contentstack017_TaxonomyTest.cs
Outdated
Show resolved
Hide resolved
Contentstack.Management.Core.Tests/IntegrationTest/Contentstack017_TaxonomyTest.cs
Show resolved
Hide resolved
cs-raj
previously approved these changes
Mar 11, 2026
The base branch was changed.
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
cs-raj
approved these changes
Mar 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the full Taxonomy and Terms API in the .NET Contentstack Management SDK to align with the JavaScript CMA SDK. Supports managing taxonomies and their terms (CRUD, export, locales, localize, import; term hierarchy, move, search).
Changes
New Models
TaxonomyModel.csTermModel.csTaxonomyImportModel.csIUploadInterfacefor taxonomy import (multipart form key"taxonomy"; file path or Stream + filename)Taxonomy API (
Taxonomy.cs)BaseModel<TaxonomyModel>withresourcePath/taxonomiesor/taxonomies/{uid},fieldName"taxonomy".ParameterCollection).Query()returnsQueryfor listing taxonomies.{resourcePath}/export(sync/async).{resourcePath}/locales(sync/async).{ taxonomy: model }and query params (sync/async)./taxonomies/importviaUploadServicewithTaxonomyImportModel(sync/async).Terms(termUid = null)returnsTerm(requires taxonomy Uid; used for single term or term collection).Term API (
Term.cs)BaseModel<TermModel>withresourcePath/taxonomies/{taxonomyUid}/termsor.../terms/{termUid},fieldName"term".Query()for listing terms (when no term Uid)..../ancestorsand.../descendants(sync/async)..../movewithTermMoveModel(sync/async)..../locales(sync/async).{ term: model }and query params (sync/async)./taxonomies/$all/termswithtypeaheadquery param (sync/async; only when no term Uid).Stack Entry Point
Stack.cs:public Taxonomy Taxonomy(string uid = null)withThrowIfNotLoggedInandThrowIfAPIKeyEmpty; XML docs and example.Services
UploadService.cs: OptionalParameterCollectionfor query string on upload (used by Taxonomy Import).Unit Tests
TaxonomyTest.cs– Init (no uid / with uid), Create, Query, Fetch, Get Terms collection, Get single Term (10 tests).TermTest.cs– Init collection / with uid, Create, Query, Fetch, Search (10 tests)._stack.Taxonomy()/_stack.Taxonomy(uid)and_stack.Taxonomy(taxonomyUid).Terms()/.Terms(termUid); mock client andMockResponse.txt.Integration Tests
Contentstack017_TaxonomyTest.cs– Create, Fetch, Query, Update, FetchAsync, Delete (6 tests,[DoNotParallelize]).Models.cs(Tests): TaxonomyResponseModel and TaxonomiesResponseModel for API response parsing.statictaxonomy UID so the same taxonomy created in Test001 is used by Fetch/Update/Delete tests (avoidsContentstackErrorExceptionfrom operating on non-existent UIDs).Testing
Files Changed
Contentstack.Management.Core/Models/TaxonomyModel.csContentstack.Management.Core/Models/TermModel.csContentstack.Management.Core/Models/TaxonomyImportModel.csContentstack.Management.Core/Models/Taxonomy.csContentstack.Management.Core/Models/Term.csContentstack.Management.Core/Models/Stack.csContentstack.Management.Core/Services/Models/UploadService.csContentstack.Management.Core.Unit.Tests/Models/TaxonomyTest.csContentstack.Management.Core.Unit.Tests/Models/TermTest.csContentstack.Management.Core.Tests/IntegrationTest/Contentstack017_TaxonomyTest.csContentstack.Management.Core.Tests/Model/Models.cs